import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

export const ViewRoute: RouteRecordRaw[] = [
  {
    path: '/home',
    component: () => import('@/views/home/Home.vue'),
    meta: {
      name: 'HO',
    },
  },
  {
    path: '/registry',
    component: () => import('@/views/registry/Registry.vue'),
    meta: {
      name: 'RE',
    },
  },
  {
    path: '/test',
    component: () => import('@/views/test/Test.vue'),
    meta: {
      name: 'TEST',
    },
  },
]

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('@/layout/Layout.vue'),
    children: [...ViewRoute],
    redirect: '/home',
  },
]

export const router = createRouter({
  history: createWebHashHistory(),
  routes,
})
